home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / lib / rpm-3.0.6 / brp-strip < prev    next >
Encoding:
Text File  |  2001-04-06  |  372 b   |  13 lines

  1. #!/bin/sh
  2. # If using normal root, avoid changing anything.
  3. if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
  4.     exit 0
  5. fi
  6.  
  7. # Strip ELF binaries
  8. for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
  9.     grep -v ' shared object,' | \
  10.     sed -n -e 's/^\(.*\):[     ]*ELF.*, not stripped/\1/p'`; do
  11.     strip $f || :
  12. done
  13.